package com.vimhe.ezimp2.handler.formatter.support;

import com.vimhe.ezimp2.handler.Formatter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 日期格式化转换器
 *
 * @author Vimhe
 */
public class DateFormatter implements Formatter<Date> {

    @Override
    public String name() {
        return "dateFormatter";
    }

    @Override
    public String format(Date cellValue, String formatterValue) {
        DateFormat format = new SimpleDateFormat(formatterValue);
        return format.format(cellValue);
    }

}
